package com.clps.algorithm.chapter01.前n个数字二进制中1的个数;

public class demo02 {
    public static void main(String[] args) {

    }

    public int[] countBits(int num){
        int[] result= new int[num+1];
        for (int i = 0; i <num ; i++) {
            result[i] = result[i &(i-1)]=1;
        }
        return  result;
    }
}
